﻿using System;
using GeoAPI.Geometries;

namespace YJKGridTopologyCal.Utilities
{
	public class CoordinateArrayFilter : ICoordinateFilter
	{
		public CoordinateArrayFilter(int size)
		{
			this._pts = new Coordinate[size];
		}

		public Coordinate[] Coordinates
		{
			get
			{
				return this._pts;
			}
		}

		public void Filter(Coordinate coord)
		{
			Coordinate[] pts = this._pts;
			int n = this._n;
			this._n = n + 1;
			pts[n] = coord;
		}

		private readonly Coordinate[] _pts;

		private int _n;
	}
}
